package mytest.wd2;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import pojo.Circulation;
import pojo.Phone;

import java.util.ArrayList;
import java.util.List;

public class Test8 {
    public static void main(String[] args) {
        ArrayList<Circulation> circulationList = new ArrayList<>();
        Circulation circulation = new Circulation();
        circulation.setStage("s1");
        circulation.setBegin("0");
        circulation.setEnd("6");
        circulation.setCallGroup("第一组");
        circulationList.add(circulation);
        Circulation circulation2 = new Circulation();
        circulation2.setStage("s2");
        circulation2.setBegin("7");
        circulation2.setEnd("13");
        circulation2.setCallGroup("第二组");
        circulationList.add(circulation2);

        String json = new Gson().toJson(circulationList);

        List<Circulation> circulationList2 = new Gson().fromJson(json, new TypeToken<List<Circulation>>() {}.getType());
        System.out.println(circulationList2);

    }
}
